/* Copyright 2012 Dustin Mitchell <dmmitche [at] gmail [dot] com>
 *
 * Licensed under the GPLv3.  See included LICENSE.txt for full details.
 */

#ifndef __SENSOR_MANAGER__
#define __SENSOR_MANAGER__

#include "hash.h"
#include "sensor.h"

struct sensor_manager
{
  struct hash sensors;
};

int sensor_manager_create (struct sensor_manager *mgr);

void sensor_manager_destroy (struct sensor_manager *mgr);

int sensor_manager_register (struct sensor_manager *mgr, union sensor *sensor,
                             int sensor_id);

/* Blocks waiting for a sensor reading, returns the sensor id the reading
 * represents */
int sensor_manager_read (struct sensor_manager *mgr,
                         union sensor_reading *reading);

#endif /* __SENSOR_MANAGER__ */
